﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ContainerCommentEditForm.aspx.vb"
    Inherits="InSiteWebApplication.ContainerCommentEditForm" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>修改批次备注</title>
    <link href="/InSiteWebApplication/Content/Easyui/themes/metro/easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/custom-easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/themes/icon.css" rel="stylesheet" />
</head>
<body runat="server">
    <form id="form1" runat="server">
    <div style="height: 120px">
        <div class="ufcSectionStyle">
            <span class="ufcSectionSpanStyle">批次备注信息</span>
        </div>
        <fb:TextBox ID="ContainerCommentField" runat="server" TextControl-TextMode="MultiLine"
            Text="批次备注" TextControl-Width="560px" TextControl-Height="55px" Style="position: relative;
            top: 12px; float: left" DependsOn="" EnableSmartScan="True" Encryption="True"
            FieldExpressions="" ForceSubmit="False" HideLabel="False" LabelControl-CssClass="LabelControl"
            LabelControl-FieldExpressions="" LabelControl-FieldInfoType="" LabelControl-ID="9af218bf-7ccc-48ba-9cd3-39bf338fddbalbct"
            LabelControl-LabelType="Designer" LabelControl-Text="批次备注" LabelType="Designer"
            ReadOnly="False" SmartScanTypeName="" TextControl-CssClass="TextMedium" TextControl-ID="ContainerTxtCommentField">
        </fb:TextBox>
    </div>
    <div>
        <div class="ufcSectionStyle">
            <span class="ufcSectionSpanStyle">模板区域</span>
        </div>
        <table id="gdRecordInfo" class="easyui-datagrid" style="width: 100%; height: 450px"
            data-options="checkOnSelect:true,selectOnCheck:true">
        </table>
        <div class="ufcSectionStyle">
            <span class="ufcSectionSpanStyle">按钮区域</span>
        </div>
        <div style="margin-top: 3px">
            <a href="#" id="saveData" class="easyui-linkbutton" style="width: 100px; margin-left: 10px;">
                确定</a>
        </div>
    </div>
    <div style="clear: both">
    </div>
    <div style="margin-top: 3px; width: 100%">
        <div class="ufcSectionStyle">
            <span class="ufcSectionSpanStyle">按钮区域</span>
        </div>
        <div style="margin: 3px 0px 3px 3px; width: 100%">
            <fb:Button ID="btSave" Style="z-index: 102;" Visible="true" DisplayInFrame="False"
                runat="server" Width="72px" Text="保存"></fb:Button>
            <fb:Button ID="CloseButton" runat="server" Width="90px" Text="关闭" DisplayInFrame="False"
                Style="position: relative; left: 20px; top: 0px;"></fb:Button>
        </div>
        <div>
            <fb:Message ID="StatusMessage" Style="z-index: 103; left: 8px; position: relative;
                top: 6px;" runat="server" Height="16px"></fb:Message>
        </div>
    </div>
    <input type="hidden" id="txtcontainerName" runat="server" />
    </form>
</body>
</html>
<script src="/InSiteWebApplication/Content/Easyui/jquery.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script type="text/javascript">
    var tdata = [
     { "dname": "使用方", "dvalue": "" },
     { "dname": "代料单号", "dvalue": "" },
     { "dname": "毛坯超差单号", "dvalue": "" },
     { "dname": "型别", "dvalue": "" },
     { "dname": "分卡信息", "dvalue": "" },
     { "dname": "产品用途", "dvalue": "" },
     { "dname": "产品箱号", "dvalue": "" },
     { "dname": "例外放行审理单编号", "dvalue": "" },
     { "dname": "产品状态", "dvalue": "" },
     { "dname": "棒材顺序号", "dvalue": "" },
     { "dname": "试棒数量", "dvalue": "" },
     { "dname": "状态信息说明", "dvalue": "" }
    ];
    var page = {
        init: function () {
            this.bind();
        },
        //页面事件绑定
        bind: function () {

            $("#gdRecordInfo").datagrid({
                columns: [[
                 { field: 'ck', title: '选择', checkbox: true },
		         { field: 'dname', title: '', width: 100 },
                 { field: 'dvalue', title: '', width: 300,
                     formatter: function (value, row, index) {
                         if (row.dname == "使用方") {
                             return '<select id="gridtxt' + index + '" class="easyui-combobox" name="gridtxt' + index + '" style="width:290px;">' +
                             '<option value=""></option><option value="空军使用">空军使用</option><option value="海军使用">海军使用</option><option value="外贸使用">外贸使用</option></select>'
                         } else {
                             return '<input id="gridtxt' + index + '" name="gridtxt' + index + '" class="easyui-textbox" style="width:290px">';
                         }
                     }
                 }
                 ]]
            });
            $("#gdRecordInfo").datagrid('loadData', tdata);
            $("#saveData").on("click", function () {
                var rows = $("#gdRecordInfo").datagrid('getChecked'); //获取所有勾选的行
                var resStr = "";
                for (var i = 0; i < rows.length; i++) {
                    var index = $("#gdRecordInfo").datagrid('getRowIndex', rows[i]); //获取改行的index
                    var content = $.trim($('input[name="gridtxt' + index + '"]').val());
                    if (content != "") {
                        resStr += $('input[name="gridtxt' + index + '"]').val() + ";"; //通过index对应name获取数据
                    }
                }
                var formdia = parent.$("#winFormDialog");
                var data = formdia.dialog('options');
                data.outParam = resStr;
                formdia.dialog('options', data);
                formdia.dialog('close')
            });
        }
    };
    page.init();
</script>
